package com.zcl.generic;

import com.sun.istack.internal.NotNull;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @Description:
 * @author: zcl
 * @date: 2022/3/11  13:57
 *
 *
 * 泛型类
 */
public class Order<T,V> {

    private String orderName;

    private T orderT;

    private V hahaV;


    public Order(){
    }

    public Order(V hahaV) {
        this.hahaV = hahaV;
    }

    public Order(String orderName, T orderT) {
        this.orderName = orderName;
        this.orderT = orderT;
    }

    public V getHahaV() {
        return hahaV;
    }

    public void setHahaV(V hahaV) {
        this.hahaV = hahaV;
    }

    public String getOrderName() {
        return orderName;
    }

    public void setOrderName(String orderName) {
        this.orderName = orderName;
    }

    public T getOrderT() {
        return orderT;
    }

    public void setOrderT(T orderT) {
        this.orderT = orderT;
    }

    //泛型方法
    public <E> List<E> copyFromArrayToList(@NotNull E[] arr){
        ArrayList<E> list = new ArrayList<>();
        Collections.addAll(list, arr);
        return list;
    }

}
